import request from '@/utils/request'

// api地址
const api = {
	phonePassLogin:'/index.php?s=/api/login/phonePassLogin',
	phoneLogin:'/api/Login/phoneLogin',
	login_phone:'/api/Login/phoneLogin',
	register:'/api/login/phoneRegister',
	getMiniToken:"/api/login/getMiniToken",//微信小程序授权登录（新）
	getZfbToken:'/api/login/getZfbToken',//支付宝授权登录
	getZfbphone:'/api/login/getZfbphone',//支付宝获取手机号
	getMiniPhone:"/api/login/getMiniPhone",//微信小程序获取手机号登录
	getBaiduPhone:"/api/login/getBaiduPhone", //百度小程序授权手机号登录
	getZiJieToken:"/api/login/getZiJieToken",//抖音小程序授权手机号登录
	getKsToken:'/api/login/getKsToken',//快手小程序授权手机号登录
	mePhone:"/api/login/mePhone",//一键登录
}
// 密码登录
export const phonePassLogin = param => {
  return request.post(api.phonePassLogin, param )
}
// 验证码登录
export const phoneLogin = param => {
  return request.post(api.phoneLogin, param )
}

// 注册
export const register = param => {
  return request.post(api.register, param )
}
//微信小程序授权登录
export const getMiniToken = (param, option) => {
  return request.post(api.getMiniToken, param)
}
//支付宝小程序授权登录
export const getZfbToken = (data) => {
	return request.post(api.getZfbToken,data)
}
export const getZfbphone = (data) => {
	return request.post(api.getZfbphone,data)
}
export const getMiniPhone = (data) => {
	return request.post(api.getMiniPhone,data)
}
export const getBaiduPhone = (data) => {
	return request.post(api.getBaiduPhone,data)
}
export const getZiJieToken = (data) => {
	return request.post(api.getZiJieToken,data)
}
export const getKsToken = (data) => {
	return request.post(api.getKsToken,data)
}
export const mePhone = (data) => {
	return request.post(api.mePhone,data)
}